import { Actor } from '../Actor';
import { NodeCanvasRenderingContext2D } from 'canvas';

export class ColorBar extends Actor {
	_paint(_: unknown, ctx: NodeCanvasRenderingContext2D, frame: number, time: number): void {
		const { width, height } = ctx.canvas;
		const barWidth = width / 8;

		ctx.fillStyle = '#ffffff';
		ctx.fillRect(0, 0, barWidth, height);
		ctx.fillStyle = '#ffff00';
		ctx.fillRect(barWidth, 0, barWidth, height);
		ctx.fillStyle = '#00ffff';
		ctx.fillRect(2 * barWidth, 0, barWidth, height);
		ctx.fillStyle = '#00ff00';
		ctx.fillRect(3 * barWidth, 0, barWidth, height);
		ctx.fillStyle = '#ff00ff';
		ctx.fillRect(4 * barWidth, 0, barWidth, height);
		ctx.fillStyle = '#ff0000';
		ctx.fillRect(5 * barWidth, 0, barWidth, height);
		ctx.fillStyle = '#0000ff';
		ctx.fillRect(6 * barWidth, 0, barWidth, height);
		ctx.fillStyle = '#000000';
		ctx.fillRect(7 * barWidth, 0, barWidth, height);
	}
}
